package com.example.yunJie.digitalSentry.mapper.one;



import com.example.yunJie.digitalSentry.entity.MarketEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.io.Serializable;
import java.util.List;

public interface MarketMapper {
//    @Insert("<script> insert into sz_market(marketId,marketName)\n" +
//            "        values(#{marketId},#{marketName})</script>")
    int insert(MarketEntity marketEntity);

//    @Update("<script>update sz_market\n" +
//            "        <trim prefix=\"SET\" suffixOverrides=\",\">\n" +
//            "            <if test=\"marketId != null\">marketId = #{marketId},</if>\n" +
//            "            <if test=\"marketName != null\">marketName = #{marketName},</if>\n" +
//            "        </trim>\n" +
//            "        where id = #{id}</script>")
    int update(MarketEntity marketEntity);

//    @Delete("<script>delete from sz_market where id = #{Id}</script>")
    int deleteById(Serializable id);

//    @Delete("<script>delete from sz_market where id in\n" +
//            "        <foreach collection=\"array\" item=\"id\" open=\"(\" separator=\",\" close=\")\">\n" +
//            "            #{id}\n" +
//            "        </foreach></script>")
    int deleteIdList(List<Integer> idList);

//    @Select("<script> select  marketId,marketName\n" +
//            "        from sz_market\n" +
//            "        where id = #{id}</script>")
    MarketEntity findId(String id);

//    @Select("<script> select * from sz_market</script>")
    List<MarketEntity> findAll();

    //根据市场名查找市场id
//    @Select("<script> select * from sz_market where marketName = #{marketName}</script>")
    MarketEntity findIdByMarketName(String marketName);
}
